/**
 *
 */
package com.dhcc.frame.guava.collection;

import java.util.List;

import io.github.benas.jpopulator.api.Populator;
import io.github.benas.jpopulator.impl.PopulatorBuilder;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.google.common.collect.ImmutableList;

/**
 * @author 谢进军
 *
 */
public class ImmutableListTest {
	private Logger logger = LoggerFactory.getLogger( ImmutableListTest.class );
	private Populator populator = new PopulatorBuilder().build();

	@Test
	public void testSetString(){
		ImmutableList<String> colorNames = ImmutableList.of(
		        "red",
		        "orange",
		        "yellow",
		        "green",
		        "blue",
		        "purple");
		String xx = colorNames.get(1);
		System.out.println( colorNames.get(1));
		System.out.println(xx);
		xx = "2";
		System.out.println(xx);
		System.out.println( colorNames.get(1));
	}

	@Test
	public void testList(){
		List<City> cityLis = populator.populateBeans(City.class, 5);
		ImmutableList<City> immutableList = ImmutableList.copyOf(cityLis);
//		City city = immutableList.get(1); city.setName("1");
		immutableList.get(1).setName("name");
		logger.info( immutableList.get(1).getName());
	}
}
